/*
    Copyright (C) 2008  Helmut Juskewycz

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/
package com.juskewycz.dividere.action.join;

import com.juskewycz.dividere.core.*;

/**
 * A Joiner allows to join file pieces back to the original file.
 * 
 * @author Helmut Juskewycz
 * @createdon 27. January 2008
 * @lastmodified 27. January 2008
 * @history
 * 27. January 2008 Finished version 1.0
 */
public interface IJoiner {
    
    //constants for messages regarding the joining process
    public static final String ERROR_OUTPUT_FILE_EXISTS = "errorOutputFileExists";
    public static final String ERROR_PATH_MISSING_DOT = "errorMissingDot";
    public static final String ERROR_FILE_IO = "errorFileIOMessage";
    public static final String ERROR_FIRST_FILE_NOT_EXIST = "errorFirstFileNotExists";
    public static final String ERROR_FIRST_PART_PATH_NOT_EXISTS = "errorFirstPartPathNotExists";
    public static final String ERROR_NOT_ALL_FILES_EXISTS = "errorNotAllFilesExists";
    
    /**
     * Joins file pieces to the orginal file. The file pieces have to be named
     * like _name_._extension_001, _name_._extension_002, ... The large file
     * will be name _name_._extension_
     * 
     * @param firstPiecePath
     */
    public void join(String firstPiecePath);
    
    /**
     * Adds a join listener to the joiner.
     * 
     * @param listener
     */
    public void addListener(IJoinListener listener);
    
    /**
     * Removes a join listener to the joiner.
     * 
     * @param listener
     */
    public void removeListener(IJoinListener listener);

}
